package co.com.smart.eagle.entities;

import java.io.Serializable;

import javax.persistence.*;

/**
 * The primary key class for the menus_x_menu database table.
 * 
 */
@Embeddable
public class EagleSecurityMenusXMenuPK implements Serializable {
	// default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_menu_parent")
    private Long idMenuParent;
	@Column(name="id_menu_child")
    private Long idMenuChild;

	public EagleSecurityMenusXMenuPK() {
	}

	public Long getIdMenuParent() {
		return idMenuParent;
	}

	public void setIdMenuParent(Long idMenuParent) {
		this.idMenuParent = idMenuParent;
	}

	public Long getIdMenuChild() {
		return idMenuChild;
	}

	public void setIdMenuChild(Long idMenuChild) {
		this.idMenuChild = idMenuChild;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((idMenuChild == null) ? 0 : idMenuChild.hashCode());
		result = prime * result
				+ ((idMenuParent == null) ? 0 : idMenuParent.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EagleSecurityMenusXMenuPK other = (EagleSecurityMenusXMenuPK) obj;
		if (idMenuChild == null) {
			if (other.idMenuChild != null)
				return false;
		} else if (!idMenuChild.equals(other.idMenuChild))
			return false;
		if (idMenuParent == null) {
			if (other.idMenuParent != null)
				return false;
		} else if (!idMenuParent.equals(other.idMenuParent))
			return false;
		return true;
	}
	
}